-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withNotices: Convert to TypeScript #49088
Conversation
Size Change: +93 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
*/ | ||
export default createHigherOrderComponent( ( OriginalComponent ) => { | ||
function Component( | ||
props: { [ key: string ]: any }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for this PR, but we should find a way for consumers of this HOC to get type checks on these props (ie. if they are compatible with OriginalComponent
's prop types)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe this will require TS changes in the createHigherOrderComponent
function so the return function can take a generic argument.
Part of #35744
What?
Convert the
withNotices
HOC to TypeScript.Testing Instructions
✅ Static checks pass